/**
 * Additional content section / block functions for body.
 */

var rootpath = process.cwd() + '/',
    path = require('path'),
    calipso = require(path.join(rootpath, 'lib/calipso')),
    Query = calipso.lib.mongoose.Query;

exports = module.exports = function(req,options,callback) {

    var contentName;

    if (req.query.content === 'pastor') {
        contentName = 'church-about-pastor'
    } else if (req.query.content === 'worshipService') {
            contentName = 'church-about-worshipService'
    } else if (req.query.content === 'newFamily') {
        contentName = 'church-about-newfamily';
    } else if (req.query.content === 'churchHistory') {
        contentName = 'church-about-history';
    } else if (req.query.content === 'ministry') {
        contentName = 'church-about-ministry';
    } else if (req.query.content === 'location') {
        contentName = 'church-about-location';
    } else {
        contentName = 'church-about-pastor'
    }

    /**
     *  Get additional content for blocks in the template
     */
    calipso.lib.step(
        function getContentList() {

            // Create a query and retrieve the content, has pager support, using req.moduleParams
            // But you can override on an individual query by setting in the options (second param)

            options.getContent(req, contentName, this.parallel());

        },
        function done(err, churchAboutContent) {

            callback(err,{ contentName:contentName, churchAboutContent:churchAboutContent });

        }
    );

};